*** Settings ***
Library           SeleniumLibrary
Library           String
Library           AutoItLibrary
Resource          采购目录.txt
Resource          采购品目.txt
Resource          ../常用变量.txt
Resource          ../基本配置.txt
Resource          ../浏览器变量.txt
Resource          ../常用变量.txt
Resource          招标代理机构页面元素.txt
Resource          供应商信息.txt

*** Test Cases ***
招标代理机构-添加一级招标-集中采购
    [Setup]    login
    #打开添加招标代理机构页面
    goto    ${agent_manager_add}
    #输入代理机构的基本信息
    ${provider_name}    Generate Random String    10
    供应商名称    ${provider_name}
    ${provider_Legal representative}    Generate Random String    6
    法人代表    ${provider_Legal representative}
    排序    1
    Comment    ${provider_id}    evaluate    "".join(random.sample("0123456789",6))    random,string
    Comment    编码    ${provider_id}
    ${provider_business_license}    Generate Random String    16
    营业执照    ${provider_business_license}
    招标代理机构-采购代理类型-集中采购
    招标代理机构-工商注册日期
    ${provider_contact}    Generate Random String    5
    联系人    ${provider_contact}
    ${provider_phone}    evaluate    random.choice(['139','188','185','136','158','151'])+"".join(random.choice("0123456789") for i in range(8))    random
    手机    ${provider_phone}
    log    ${provider_phone}
    ${provider_tel}    evaluate    random.choice(['139','188','185','136','158','151'])+"".join(random.choice("0123456789") for i in range(8))    random
    电话    ${provider_tel}
    ${email}    随机邮箱
    电子邮件    ${email}
    ${provider_address}    Generate Random String    20
    地址    ${provider_address}
    ${provider_bank_id}    Generate Random String    16
    招标代理机构-招标代理分类-一级机构
    招标代理机构-具有国际招标-是
    #默认可用状态为可用
    ${provider_remark}    Generate Random String    25
    供应商-备注    ${provider_remark}
    供应商-保存
    sleep    3
    招标代理机构断言机构添加成功    ${provider_name}
    [Teardown]    close

招标代理机构-添加二级招标-其他采购
    [Setup]    login
    #打开添加招标代理机构页面
    goto    ${agent_manager_add}
    #输入代理机构的基本信息
    ${provider_name}    Generate Random String    10
    供应商名称    ${provider_name}
    ${provider_Legal representative}    Generate Random String    6
    法人代表    ${provider_Legal representative}
    排序    1
    Comment    ${provider_id}    evaluate    "".join(random.sample("0123456789",6))    random,string
    Comment    编码    ${provider_id}
    ${provider_business_license}    Generate Random String    16
    营业执照    ${provider_business_license}
    招标代理机构-采购代理类型-其他采购
    招标代理机构-工商注册日期
    ${provider_contact}    Generate Random String    5
    联系人    ${provider_contact}
    ${provider_phone}    evaluate    random.choice(['139','188','185','136','158','151'])+"".join(random.choice("0123456789") for i in range(8))    random
    手机    ${provider_phone}
    log    ${provider_phone}
    ${provider_tel}    evaluate    random.choice(['139','188','185','136','158','151'])+"".join(random.choice("0123456789") for i in range(8))    random
    电话    ${provider_tel}
    ${email}    随机邮箱
    电子邮件    ${email}
    ${provider_address}    Generate Random String    20
    地址    ${provider_address}
    ${provider_bank_id}    Generate Random String    16
    招标代理机构-招标代理分类-一级机构
    招标代理机构-具有国际招标-是
    #默认可用状态为可用
    ${provider_remark}    Generate Random String    25
    供应商-备注    ${provider_remark}
    供应商-保存
    sleep    3
    招标代理机构断言机构添加成功    ${provider_name}
    [Teardown]    close

招标代理机构-修改
    [Setup]    login
    add_agency
    goto    ${agent_manager_list}
    capture page screenshot
    招标代理机构修改按钮
    log    修改招标代理机构信息
    ${agency_list_title}    get window handles
    log    ${agency_list_title}
    log    点击修改按钮，进入修改页面
    log    输入功代理机构基本信息
    ${provider_name}    Generate Random String    10
    供应商名称    ${provider_name}
    ${provider_Legal representative}    Generate Random String    6
    法人代表    ${provider_Legal representative}
    排序    1
    Comment    ${provider_id}    evaluate    "".join(random.sample("0123456789",6))
    Comment    编码    ${provider_id}
    ${provider_business_license}    Generate Random String    16
    营业执照    ${provider_business_license}
    招标代理机构-采购代理类型-集中采购
    招标代理机构-工商注册日期
    ${provider_contact}    Generate Random String    5
    联系人    ${provider_contact}
    ${provider_phone}    evaluate    random.choice(['139','188','185','136','158','151'])+"".join(random.choice("0123456789") for i in range(8))    random
    手机    ${provider_phone}
    log    ${provider_phone}
    ${provider_tel}    evaluate    random.choice(['139','188','185','136','158','151'])+"".join(random.choice("0123456789") for i in range(8))    random
    电话    ${provider_tel}
    ${email}    随机邮箱
    电子邮件    ${email}
    ${provider_address}    Generate Random String    20
    地址    ${provider_address}
    ${provider_bank_id}    Generate Random String    16
    招标代理机构-招标代理分类-一级机构
    招标代理机构-具有国际招标-是
    #默认可用状态为可用
    可用状态-停用
    ${provider_remark}    Generate Random String    25
    供应商-备注    ${provider_remark}
    供应商-保存
    sleep    3
    招标代理机构断言机构添加成功    ${provider_name}
    [Teardown]    close
